{if $op == 'post'}
<script src="{MODULE_URL}library/aliyunVod/js/aliyun-oss-sdk-5.2.0.min.js"></script>
<script src="{MODULE_URL}library/aliyunVod/js/aliyun-upload-sdk-1.4.0.min.js"></script>
<script src="{MODULE_URL}library/aliyunVod/js/es6-promise.min.js"></script>
{/if}
{template 'common/header'}

<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_879979_grhzbin7y3.css">
<style type="text/css">
	#close1{
		position:absolute;
		right:-25px;top:-25px;
		z-index: 999;
		font-size: 14px;
		color: #000;
		background: #cecece;
		border-radius: 50%;
		width: 24px;
		height: 24px;
		text-align: center;
		line-height: 24px;
		cursor: pointer;
		font-weight: bolder;
		border: 1px solid #cecece;
		box-sizing: border-box;
		font-family: iconfont;
	}
	#close1:hover{
		background: #fff;
		border: 1px solid red;
		color: red;
		background: #fff;
	}
	#edit{
		height:34px;
		width:82px;
		background-color: #ef4e4e;
		border-radius: 6px;
		color:#fff;
		line-height: 34px;
		text-align: center;

	}
	.prism-ErrorMessage{
		display:none;
	}
	.prism-auto-stream-selector{
		display:none;
	}
</style>
<style type="text/css">
	.toast-wrap{
		display: none;
	}
	.mark{
		position: fixed;z-index: 1000;top: 0;right: 0;left: 0;bottom: 0;background: rgba(0, 0, 0, 0.2);z-index: 99;
	}
	.con{
		width: 500px;
		height: 200px;
		border-radius: 5px;
		background: #FFFFFF;
		font-size: 18px;
		box-shadow: 0 1px 10px rgba(228, 234, 236, 1);
		z-index: 2000;
		position: absolute;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		margin: auto;
		padding: 10px 10px 44px;
	}
	.tips{
		color: #B3B3B3;
	}
	.content p{
		font-size: 16px;
		color: #4D4D4D;
		line-height: 32px;
		width: 100%;
		word-wrap:break-word;
	}
	.confirm{
		height: 44px;
		position: absolute;
		bottom: 0;
		text-align: right;
		width: 100%;
	}
	.confirm .tit{
		background: #62a8ea;
		color: #FFFFFF;
		text-align: center;
		line-height: 36px;
		width: 64px;
		height: 36px;
		border-radius: 4px;
		cursor: pointer;
		position: absolute;
		right: 20px;
		top: 0;
	}
</style>

<ul class="nav nav-tabs">
    <li {if $op == 'list'}class="active"{/if}>
        <a href="{php echo $this->createWebUrl('son',array('op'=>'list','lid'=>$lessonname['id']))}" >章节列表</a>
    </li>
    <li {if $op == 'post'}class="active"{/if}>
        <a href="{php echo $this->createWebUrl('son',array('op'=>'post','lid'=>$lessonname['id']))}" >{if empty($info['id'])}添加章节{else}修改章节{/if}</a>
    </li>
</ul>
{if $op == 'list'}
<div class="row clearfix" >
	<div class="col-md-12 column">
		<!--<div class="col-md-12 column">-->
			<div class="list-group">
				<p  class="list-group-item " style="background-color:#D9EDF7 " >课程:&nbsp;&nbsp;{$lessonname['title']}
					<span style="color:red;float:right">因视频转码需要时间，请在视频可预览后再将章节改为上架状态上架</span></p>
				<div active="list-group-item" style="border:1px solid #cecece;">
					<table class="table table-hover table-bordered" style="margin-top:25px;width:98%" align="center">
						<thead>
							<tr>
								<th>
									{if $paixu == 2}
									<a href="{php echo $this->createWebUrl('son',['op'=>'list','lid'=>$lid,'paixu'=>1])}">
										排序 <img src="{php echo MODULE_URL.'images/up.png'}" alt="" style="height: 14px;">
									</a>
									{elseif $paixu == 1}
									<a href="{php echo $this->createWebUrl('son',['op'=>'list','lid'=>$lid,'paixu'=>2])}">
										排序 <img src="{php echo MODULE_URL.'images/down.png'}" alt="" style="height: 14px;">
									</a>
									{/if}
								</th>
								<th width="15%">章节标题</th>
								<th width="12%">章节状态</th>
								<th width="20%">章节类型</th>
								<!--<th>排序值</th>-->
								<th>观看人次</th>
								<th>完播人数</th>
								<th width="30%">操作</th>
							</tr>
						</thead>
						<tbody>
							{loop $sonlist $row}
							<tr>
								<td class="inp col-sm-1" data-id="{$row['id']}">{$row['orders']}</td>
								<td style="{if $row['vstatus'] == 404}color:red{/if}">{$row['title']}</td>
								<td ><button value="{$row['id']}" {if $row['status'] == 2 || $row['vstatus'] == 404}class="btn btn-danger status"{elseif $row['status'] == 1}class="btn btn-info status"{/if} >{if $row['status'] == 2 || $row['vstatus'] == 404}下架{elseif $row['status'] == 1}上架{/if}</button>{if $row['vstatus'] == 404}<span style="float: right;color:red">(转码中……)</span>{/if}</td>

								<td>
									{if $row['sontype'] == 1 }
										直播章节，开课时间{php echo date('Y-m-d H:i:s',$row['starttime'])}
									{elseif $row['sontype'] == 3}
										直播中章节
									{elseif $row['sontype'] == 6}
										classin直播章节
									{elseif $row['sontype'] == 4}
										{if $row['starttime'] > time()}
											伪直播未开始章节
										{elseif $row['starttime'] < time() && ($row['starttime'] + $row['vediotime']) > time() }
											伪直播中的章节
										{else}
											录播章节
										{/if}
									{else}
										录播章节
									{/if}
								</td>

								<td>{$row['num']}</td>
								<td>{$row['studynum']}</td>
								<td>
									{if $row['sontype'] == 2 || $row['sontype'] == 4}
										<button  class="btn btn-info play" value="{$row['id']}">预览视频</button>
									{/if}
									<a href="{php echo $this->createWebUrl('son',array('op'=>'post','id'=>$row['id'],'lid'=>$lessonname['id']))}" class="btn btn-success">修改</a>
									<a href="{php echo $this->createWebUrl('son',array('op'=>'delete','id'=>$row['id']))}" class="btn btn-danger">删除</a>
									<a href="{php echo $this->createWebUrl('son',['op'=>'download','sonid'=>$row['id']])}" class="btn btn-success">导出</a>
									<a href="{php echo $this->createWebUrl('practice',['op'=>'list','lid'=>$lessonname['id'],'sonid'=>$row['id']])}" class="btn btn-success">习题列表</a>
									{if $row['sontype'] == 1}
										<span onclick="geturl({$row['id']})" class="btn btn-default">推流参数</span>
									{/if}
								</td>
							</tr>
							{/loop}
						</tbody>
					</table>
				</div>


				<div id="hkg_play"  style="display:none;width: 100%;height: 100%;">
					<div style="position: absolute;top: 200px;left: 0;right: 0;bottom: 0;margin:auto;z-index: 99;width: 640px;height: 400px;">
						<div id="close1">&#xe609;</div>
						<div id="J_prismPlayer" style=""></div>
					</div>
				</div>
			</div>
		</div>
	<!--</div>-->
</div>


<div class="toast-wrap">
	<div class="mark"></div>
	<div class="con">
		<div class="tips">
			推流地址
		</div>
		<p style="color:red">推流参数需通知直播老师，该参数有效时间为120分钟！</p>
		<div class="content hkg_content">

		</div>
		<div class="confirm">
			<div class="tit">
				确定
			</div>
		</div>
	</div>
</div>

<script  type="text/javascript" src="//g.alicdn.com/de/prismplayer/2.6.0/aliplayer-min.js"></script>
<link rel="stylesheet" href="//g.alicdn.com/de/prismplayer/2.6.0/skins/default/aliplayer-min.css" />
<script type="text/javascript">
    $('#close1').on('click',function(){
        location.reload();
    });
    $(".play").click(function(){
        $('#hkg_play').fadeIn();
        var url = "{php echo $this->createWebUrl('son',array('op'=>'list'));}";
        var id = $(this).val();
        console.log(id);
        $.ajax({
            type:'get',
            url:url,
            data:{id:id},
            dataType:'json',
            success:function(info){
                console.log(info);
                var player = new Aliplayer({
                    id: "J_prismPlayer",
                    autoplay: false,
                    isLive:false,
                    playsinline:true,
                    width:"640px",
                    height:"400px",
                    controlBarVisibility:"click",
                    useH5Prism:false,
                    useFlashPrism:false,
                    x5_type:"h5",
                    x5_video_position:"top",
                    vid:info.key,
                    playauth:info.playAuth,
                    cover:''
                });
            },
        });
    });
    $(".status").click(function(){
        var a = $(this);
        var status = $(this).html();
        var url = "{php echo $this->createWebUrl('son')}";
        var id = $(this).val();
        $.ajax({
            type:"POST",
            url:url,
            data:{id:id,status:status,op:'changestatus'},
            dataType:"JSON",
            success:function(res){
                 console.log(res);
                if(res.success == 1){
                    if(status == '上架'){
                        a.html('下架');
                        a.removeClass('btn-info');
                        a.addClass("btn-danger");
                    }else if(status == '下架'){
                        a.html('上架');
                        a.removeClass("btn btn-danger");
                        a.addClass("btn btn-info");
                    }
                }else{
                    alert(res.mess);
                }

            }

        });
    });
    $(".inp").dblclick(function(){
        var inp = $(this);
        if(inp.children().is('input')){
        }else{
            var id = $(this).attr('data-id');
            var val = $(this).html();
            // console.log(id);
            var input = $(this).html('<input name="order" autofocus type="number" value="'+val+'" class="form-control">');
            $('input[name="order"]').blur(function(){
                // console.log("失去焦点事件");
                var url = "{php echo $this->createWebUrl('son')}";
                var vall = $(this).val();
                // console.log(vall);
                $.ajax({
                    type:"POST",
                    url:url,
                    data:{op:'order',id:id,order:vall},
                    dataType:"JSON",
                    success:function(result){
                        inp.html(vall);
                    },
                });
            });
        }
    });
    $(".cinput").dblclick(function(){
        var inp = $(this);
        if(inp.children().is('input')){
        }else{
            var id = $(this).parent('tr').find('td').first().html();
            var val = $(this).html();
            // console.log(id);
            var input = $(this).html('<input name="cardnum" autofocus type="number" value="'+val+'" class="form-control">');
            $('input[name="cardnum"]').blur(function(){
                // console.log("失去焦点事件");
                var url = "{php echo $this->createWebUrl('son')}";
                var vall = $(this).val();
                // console.log(vall);
                $.ajax({
                    type:"POST",
                    url:url,
                    data:{op:'card',id:id,cardnum:vall},
                    dataType:"JSON",
                    success:function(result){
                        inp.html(vall);
                    },
                });
            });
        }
    });
    /*$(".type").click(function(){
        var b = $(this);
        var type = $(this).html();
        console.log(type);
        var url = "{php echo $this->createWebUrl('son')}";
        var id = $(this).val();
        $.ajax({
            type:"POST",
            url:url,
            data:{id:id,type:type,op:'post'},
            dataType:"JSON",
            success:function(res){
                // console.log(res);
                if(res > 0){
                    if(type == '需要'){
                        b.html('不需要');
                        b.removeClass('btn-info');
                        b.addClass("btn-danger");
                    }else if(type == '不需要'){
                        b.html('需要');
                        b.removeClass("btn-danger");
                        b.addClass("btn-info");
                    }
                }
            }
        });
    });*/
    function geturl(sonid){
        $.ajax({
			type:'post',
			url:"{php echo $this->createWebUrl('son',array('op'=>'geturl'))}",
			data:{id:sonid},
			success:function (res) {
			    var res = JSON.parse(res);
                console.log(res);
                $('.toast-wrap').show()
			    html = `<p>服务器：${res.live_url}</p><p>串流秘钥：${res.live_url_token}</p>`;
				$('.hkg_content').html(html);
            }
		});
	}
    $('.confirm div').click(function(){
        $('.toast-wrap').hide()
    })
</script>
{elseif $op == 'post'}
	<div class="list-group">
	<p class="list-group-item active" style="background-color: #D9EDF7;border:1px solid #D9EDF7;color:#31708F">{$lessonname['title']}课程添加章节 {if $lessonname['is_only'] == 1}<span style="color:red;float: right">单章节课程，仅可创建一个章节，重复添加会覆盖之前章节</span>{/if}	</p>
	<div active="list-group-item " style="border:1px solid #cecece">
		<form action="./index.php" method="post" class="form-horizontal"  style="padding:0 150px 0 50px;">
			<input type="hidden" name="c" value="site">
			<input type="hidden" name="a" value="entry">
			<input type="hidden" name="m" value="goouc_class">
			<input type="hidden" name="do" value="son">
			<input type="hidden" name="op" value="post">
			<input type="hidden" name="lessonid" value="{$lessonname['id']}">
			<input type="hidden" name="id" value="{$info['id']}">

			{if empty($info['key']) || $info['sontype'] == 1 || $info['sontype'] == 4}
				<div class="form-group " style="margin-top:25px">
					<label  class="col-sm-2 control-label">章节类型</label>
					<div class=" col-sm-10" style="padding-left:25px">
						<label class="radio-inline">
							<input type="radio" name="sontype" value="2" onclick="changesontype($(this))" {if $info['sontype'] == 2 || empty($info)}checked{/if}  title="录播章节" > 录播章节
						</label>
						<label class="radio-inline">
							<input type="radio" name="sontype" value="1" onclick="changesontype($(this))" {if $info['sontype'] == 1}checked{/if}  title="直播章节"> 直播章节
						</label>
						<label class="radio-inline">
							<input type="radio" name="sontype" value="4" onclick="changesontype($(this))" {if $info['sontype'] == 4}checked{/if}  title="伪直播章节"> 伪直播章节
						</label>
						{if $classin_status == 1}
						<label class="radio-inline">
							<input type="radio" name="sontype" value="6" onclick="changesontype($(this))" {if $info['sontype'] == 6}checked{/if}  title="classin直播"> classin直播
						</label>
						{/if}
						<span class="help-block">录播课程不需设置开课时间，直播课程需要设置开播时间</span>
					</div>
				</div>
			{else}
				<input type="hidden" name="sontype" value="{$info['sontype']}">
			{/if}


			<div class="form-group" style="margin-top:25px">
				<label  class="col-sm-2 control-label"><span style="color:red">*</span>章节标题</label>
				<div class="col-sm-10">
					<input type="text" name="title" value="{$info['title']}" class="form-control" style="width:98%"/>
				</div>
			</div>

			{if $info['sontype'] == 2 || $info['sontype'] == 4 || empty($soninfo)}
			<div class="form-group vedio" style="margin-top:25px">
				<label  class="col-sm-2 control-label"><span style="color:red">*</span>上传视频</label>
				<div class="col-sm-10">
					<input type="file" {if $info['key'] == ''}style="display:block"{else}style="display:none"{/if} name="file" id="files" value="{$info['title']}"  accept="video/*,audio/mp3" class="btn btn-default"/>
					{if $info['key'] != ''}<div id="edit" >修改视频</div>{/if}
					<input type="hidden" id="file_size"  value="0">
					<input type="hidden" id="uploadAuth" value="">
					<input type="hidden" id="uploadAddress" value="">
					<input type="hidden" id="videoId" name="videoId" value="{$info['key']}">
					<div class="col-md-6 column" id="hkg_jd" style="display: none;margin-top: 20px;margin-left:-16px;width:328px">
						<div class="progress active progress-striped">
							<div class="progress-bar" id="jd" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="">
							</div>
						</div>
					</div>
					<span class="help-block">视频上传成功后服务器需要一定的转码时间，<b style="color:red">无法直接预览</b>，转码完成后即可打开预览，需要时间与视频大小相关！</span>
				</div>
			</div>
			{/if}

			<!--classin独有-->
			<div class="form-group classin" style="margin-top:25px;{if $info['sontype'] != 6 }display:none;{else}display:block;{/if}">
				<label  class="col-sm-2 control-label">课程id</label>
				<div class="col-sm-10">
					<input type="number" name="cl_courseid" value="{$info['cl_courseid']}"  class="form-control" style="width:98%" onfocus="this.value=''"/>
					<span class="help-block">填写classin课程courseId</span>
				</div>
			</div>
			<div class="form-group classin" style="margin-top:25px;{if $info['sontype'] != 6 }display:none;{else}display:block;{/if}">
				<label  class="col-sm-2 control-label">章节id</label>
				<div class="col-sm-10">
					<input type="number" name="cl_classid" value="{$info['cl_classid']}"  class="form-control" style="width:98%" onfocus="this.value=''"/>
					<span class="help-block">填写classin课节lessonId</span>
				</div>
			</div>
			<!--classin独有-->
			<div class="form-group" style="margin-top:25px">
				<label  class="col-sm-2 control-label">排序</label>
				<div class="col-sm-10">
					<input type="number" name="order" value="{if empty($info['orders'])}0{else}{$info['orders']}{/if}"  class="form-control" style="width:98%" onfocus="this.value=''"/>
					<span class="help-block">数字越大排序越靠前</span>
				</div>
			</div>
			<div class="form-group" style="margin-top:25px">
				<label  class="col-sm-2 control-label">虚拟浏览量</label>
				<div class="col-sm-10">
					<input type="number" name="xnum" value="{if empty($info['xnum'])}0{else}{$info['xnum']}{/if}"  class="form-control" style="width:98%" onfocus="this.value=''"/>
					<span class="help-block">虚拟浏览量，默认为0</span>
				</div>
			</div>
			<!--设置开始时间-->
			<div class="form-group sontype" style="margin-top:25px;{if empty($info['sontype']) || $info['sontype'] == 2 }display:none;{else}display:block;{/if}">
				<label class="col-sm-2 control-label">开课时间</label>
				<div class="col-sm-10">
					{php echo tpl_form_field_date('starttime',$info['starttime'],true)}
					<span class="help-block">直播开始时间，不能小于当前时间，若小于当前时间，则视为当前时间！</span>
				</div>
			</div>

			<!--选择转码模板iD-->
			<!--<div class="form-group sontype" style="margin-top:25px;{if empty($info['sontype']) || $info['sontype'] == 2}display:none;{else}display:block;{/if}">
				<label class="col-sm-2 control-label">转码模板组ID</label>
				<div class="col-sm-10">
					<select name="vodtranscodegroupid" id=""  style="width:98%">
						{loop $grouplist $item}
						<option value="{$item['id']}" {if $item['id'] == $info['vodtranscodegroupid']}selected{/if}>{$item['name']}</option>
						{/loop}
					</select>
					<span class="help-block">注：当直播结束后，会将直播视频按所选模板进行转码储存值视频点播中，课程默认转换成录播课程！</span>
				</div>
			</div>-->

			<input type="hidden" name="token" value="{$_W['token']}">
			<div  id="btn" {if ($info['key'] != '' && $info['sontype'] == 2) || $info['sontype'] == 1 || ($info['key'] != '' && $info['sontype'] == 4)}style="float: right;margin:10px;display:block"{else}style="float: right;margin:10px;display:none;"{/if}>
				<input type="submit" name="submit"  value="保存设置" class="btn btn-info" >
			</div>
			<div style="clear: both;"></div>
		</form>
	</div>
	</div>
	<div id="hkg_tk" style="width: 100px;height: 100px;background: rgba(0,0,0,0.6);border-radius: 8px;line-height: 100px;text-align: center;font-size: 16px;color: #fff;display: none;position: fixed;top: 0;
	left: 0;right: 0;bottom: 0;margin:auto;z-index: 999">
		上传成功
	</div>
	<script type="text/javascript">
		var uploader = new AliyunUpload.Vod({
			retryCount: 5,
			'onUploadFailed': function (uploadInfo, code, message) {
				log("上传文件失败：" + uploadInfo.file.name + ",错误代码:" + code + ", 错误信息:" + message);
			},
			'onUploadSucceed': function (uploadInfo) {
				$('#btn').css({'display':'block'});
			},
			'onUploadProgress': function (uploadInfo, totalSize, loadedPercent) {
				// log("正在上传:文件名：" + uploadInfo.file.name + ", 大小:" + ((totalSize/1024)/1024).toFixed(2) + "MB, 进度:" + (loadedPercent * 100.00).toFixed(2) + "%");
				log((loadedPercent * 100.00).toFixed(2) );
			},
			'onUploadCanceled':function(uploadInfo){
				// log("用户取消上传文件：" + uploadInfo.file.name);
			},
			'onUploadstarted': function (uploadInfo) {
				if (isVodMode()) {
					if(!uploadInfo.videoId)
					{
						var uploadAuth = document.getElementById("uploadAuth").value;
						var uploadAddress = document.getElementById("uploadAddress").value;
						var videoId = document.getElementById("videoId").value;
						uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress,videoId);
					}
					else
					{
						var uploadAuth = document.getElementById("uploadAuth").value;
						var uploadAddress = document.getElementById("uploadAddress").value;
						uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress);
					}
				}
			},
			'onUploadEnd':function(uploadInfo){
				log("0");
			}
		});
		//监听选择文件事件
		var filef = function(event){
			var file = event.target.files[0];
			var file_size = parseFloat((file.size/1024)/1024).toFixed(2);
			$('#file_size').val(file_size);
			var url = "{php echo $this->createWebUrl('son',array('op'=>'getUploadInfo'));}";
			$.ajax({
				type:'POST',
				url:url,
				data: {filename:file.name},
				dataType: "json",
				success:function(res){
					console.log(res);
					if(res.VideoId){
						$('#uploadAuth').val(res.UploadAuth);
						$('#uploadAddress').val(res.UploadAddress);
						$('#videoId').val(res.VideoId);
						addfile();
					}else{
						alert('视频点播功能参数有误，请确认后再重新上传');
					}

				},
				fail: function(res){
				    alert(res);
							//log("获取上传信息失败，请刷新重试!");
				}
			});
		};
		document.getElementById("files").addEventListener('change',filef);
		function addfile(){
			var file = document.getElementById('files').files;
			var userData;
			if(isVodMode()){
				userData = '{"Vod":{"StorageLocation":"","UserData":{"IsShowWaterMark":"true","Priority":"7"}}}';
			}else{
				userData = '{"Vod":{"StorageLocation":"","Title":"'+file[0].name+'","Description":"","CateId":"","Tags":"","UserData":""}}';
			}
			log('0');
			if(isVodMode()){
				uploader.addFile(file[0],null,null,null,userData);
			}
			uploader.startUpload();
		}
		function isVodMode(){
			var uploadAuth = document.getElementById('uploadAuth').value;
			return (uploadAuth && uploadAuth.length > 0);
		};
		var textarea = document.getElementById('textarea');
		function log(value){
			if(!value){
				return;
			}
			if(Math.floor(Number(value)) <= 0 || Math.floor(Number(value)) >= 100){
				$('#hkg_jd').fadeOut()
				if(Math.floor(Number(value)) == 100){
					$('#hkg_tk').fadeIn()
					var timer=setTimeout(function(){
						$('#hkg_tk').fadeOut()
					},2000)
				}
			}else{
				$('#jd').css({width:value+'%'});
				$('#hkg_jd').fadeIn()
			}
		}
		//修改已上传的视频
		$('#edit').on('click',function(){
			var r = confirm('你确定要删除已上传视频吗？数据无价，请谨慎删除');
			if(r == true){
				var key = $('#videoId').val();
				var url = "{php echo $this->createWebUrl('son',array('op'=>'changevedio'))}";
				// console.log(key);
				$.ajax({
					type:"POST",
					url:url,
					data:{key:key,sonid:"{$info['id']}"},
					dataType:'JSON',
					success:function(res){
						if(res.success == 1){
							$('#files').css({'display':'block'});
							$('#edit').css({'display':'none'});
							$('#btn').css({'display':'none'});
							$('#videoId').val('');
						}else{
							alert(res.mess);
						}
					}
				});
			}
		});
		//切换视频类型
		function changesontype(obj){
		    var sontype = obj.val();
			console.log(sontype);
		    if(sontype == 1){
                $('.sontype').show();
                $('.vedio').hide();
                $('#btn').show();
                $('.classin').hide();
				//获取视频点播的转码组模板id级名称
                /*$.ajax({
                    type:'post',
                    url:'{php echo $this->createWebUrl("son",array("op"=>"gettransgroupid"))}',
                    data:{},
                    success:function (res) {
                        console.log(res);
                        for(var i = 0 ;i<res.length ; i++){

						}
                    }
                });*/
			}else if(sontype == 2){
                $('.sontype').hide();
                $('.vedio').show();
                $('#btn').hide();
                $('.classin').hide();
			}else if(sontype == 4){
                $('.vedio').show();
                $('.sontype').show();
                $('#btn').hide();
                $('.classin').hide();
			}else if(sontype == 6){//classin
                $('.vedio').hide();
                $('.sontype').show();
                $('#btn').show();
                $('.classin').show();
            }
		}
		/*//提交前检验
		function check(){
		    var flage;
		    var sontype = $('input[name="sontype"]:checked').val();

			if( sontype == 2 ){

			}else if(sontype == 1){
                $('#videoId').val('');

			}
			return false;
		}*/
	</script>
{/if}



